public class Demo9 {
    public static void main(String[] args) {
        Object locker = new Object();

        Thread t1 = new Thread(()->{
           synchronized (locker){
               System.out.println("等待之前");
               try {
                   locker.wait(1000);
               } catch (InterruptedException e) {
                   throw new RuntimeException(e);
               }
               System.out.println("等待之后");
           }
        });

        t1.start();
    }
}
